﻿@model IEnumerable<INTREPWEB.Models.Porto>
@{
    ViewBag.Title = "Portos";

    if (IsAjax)
    {
        Layout = null;
        <script type="text/javascript">
            $.configuraTelaAtual("Porto");
        </script>
    }
}
@Html.Partial("_ToolBar")
@if (ViewBag.Vazio == null)
{
    <table>
        <tr>
            <th>
                Nome
            </th>
            <th>
                Cidade
            </th>
            <th>
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Nome)
                </td>
                <td>
                     @Ajax.ActionLink(item.Cidade, "Editar", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "modal1", OnSuccess = "$.modalPopup('modal1')" })
                </td>
                <td>
                    @Ajax.ActionLink("x", "Deletar", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "modal1", OnSuccess = "$.modalPopup('modal1')" })
                </td>
            </tr>
        }
    </table>
}
else
{
    @Html.Partial("_SemItens")
}